package com.han.transfer.entrance;

import com.han.transfer.constant.BaseParameter;
import com.han.transfer.process.Generator;
import com.han.transfer.util.Painter;
import com.han.transfer.util.Tool;

import java.awt.image.BufferedImage;

/**
 * @author HanJiafeng
 * @date 2021年6月8日 10点33分
 */
public class Entrance {
    public static void main(String[] args) {
        Generator generator = Generator.getInstance(Generator.GeneratorTypeEnum.CHARACTER);

        Painter.setDefaultFrontName(BaseParameter.FontName.HAN_YI_BAN_FANG_JIA_SHU);

        String[][] contents = {
                {"17.02", "60", "三胖地锅鸡", "73.00", "工商银行储蓄卡(7615)", "2021-10-28 13:18:19"},
                {"17.02", "60", "特色面馆", "32.00", "工商银行储蓄卡(7615)", "2021-10-29 12:32:32"}
        };

        for (String[] content : contents) {
            BufferedImage bufferedImage = generator.drawWechatBillDetail(content[0],
                    Integer.parseInt(content[1]),
                    BaseParameter.Payment.OR_CODE,
                    content[2],
                    content[3],
                    content[4],
                    content[5]);
            String name = content[5].substring(5, 11) + "-" + System.currentTimeMillis();
            Tool.save(bufferedImage, "E:\\截图\\" + name);
        }
    }
}
